﻿using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.Domain.Uow;
using Abp.Threading.BackgroundWorkers;
using Abp.Threading.Timers;
using apbmvc.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace apbmvc.Hangfire
{
    public class MakeInactiveUsersPassiveWorker : PeriodicBackgroundWorkerBase, ISingletonDependency
    {
        private readonly IRepository<companies, int> _companiesRepository;




        public MakeInactiveUsersPassiveWorker(AbpTimer timer, IRepository<companies, int> userRepository)
     : base(timer)
        {
            _companiesRepository = userRepository;
            Timer.Period = 5000; //5s 执行一次
        }



        /// <summary>
        /// 定期执行的工作代码。
        /// </summary>
        [UnitOfWork]
        protected override void DoWork()
        {
            Logger.Debug("我待会会一直执行！！");
        }

    }
}
